<div class = "main-view"><!--最外层div-->
    <div class="left-margin top-margin"><strong class="am-text-primary am-text-lg">大使佣金结算</strong></div>
    <script>

        var fromDate = $('#startDateSelect').datepicker().on('changeDate', function (ev) {
            $scope.startDateSelect = ev.date.format('yyyy-MM-dd');
            $("#startDateSelect").val(ev.date.format('yyyy-MM-dd'));
        });

        var toDate = $('#endDateSelect').datepicker().on('changeDate', function (ev) {
            $scope.endDateSelect = ev.date.format('yyyy-MM-dd');
            $("#endDateSelect").val(ev.date.format('yyyy-MM-dd'));
        });
    </script>
    <form class="am-form-inline left-margin top-margin" role="form">
        <div class="am-form-group">
            <label class="left-margin">开始日期[必填]:</label>
            <input type="text" id="startDateSelect" ng-model="start" class="modal-input" size="16" data-date-format="yyyy-mm-dd">
            <label class="left-margin">结束日期[必填]：</label>
            <input type="text" id="endDateSelect"  ng-model="end" class="modal-input" size="16" data-date-format="yyyy-mm-dd">
            <label class="left-margin">昵称/手机号/用户ID：</label>
            <input type="text" id="nickName"  ng-model="nickName" class="modal-input" size="16">
<!--            <label class="left-margin">：</label>
            <input type="text" id="mobilePhone"  ng-model="end" class="modal-input" size="16" >
            <label class="left-margin">：</label>
            <input type="text" id="userId"  ng-model="end" class="modal-input" size="16" >-->
        </div>
        <button id="search-target" data-am-modal="{target: '#loading'}" type="submit" class="am-btn am-btn-primary left-margin" ng-click="search()" data-target="cascad-search">搜索</button>
        <button id="export-target"   type="submit" class="am-btn am-btn-primary left-margin" ng-click="exportdata()">佣金订单导出</button>
            <button type="button" class="am-btn am-btn-default" data-am-modal="{target: '#doc-modal-import', width: 800, height: 300}"><span class="am-icon-plus"></span> 结算订单</button><br>
    </form>
    <br>

    <div id = "pagination" class = "pagination"></div>
    <div class="pagination-table left-margin" id="tab_menu" style = "margin-top: 0px;">
        <form class="am-form">
            <table class="am-table-striped am-table-hover table-main">
                <thead>
                <tr>
                    <!--                    <th class="table-check"><input type="checkbox" ng-click="allSelected()"></th>-->
                    <th class="table-title">时间</th>
                    <th class="table-title">结算状态</th>
                    <th class="table-title">大使uid</th>
                    <th class="table-title">大使昵称</th>
                    <th class="table-title">大使手机号码</th>
                    <th class="table-title">总<br>佣金</th>
                    <th class="table-title">分享<br>佣金</th>
                    <th class="table-title">自购<br>佣金</th>
                    <th class="table-title">小区<br>佣金</th>
                    <th class="table-title">提成<br>佣金</th>
                    <th class="table-title">总<br>单数</th>
                    <th class="table-title">成团<br>单数</th>
                    <th class="table-title">未成团<br>单数</th>
                    <th class="table-title">退款<br>单数</th>
                    <th class="table-title">分享<br>单数</th>
                    <th class="table-title">自购<br>单数</th>
                    <th class="table-title">小区<br>单数</th>
                    <th class="table-title">提成<br>单数</th>
                </tr>
                </thead>
                <tbody>
                <tr ng-repeat="mtOrderObject in mtOrderList" id = "{{mtOrderObject.encUserId}}">

                    <td>{{mtOrderObject.order_time | date:'yyyy-MM-dd'}}</td>
                    <td>{{mtOrderObject.balanceStatusVal}}</td>
                    <td>{{mtOrderObject.uid}}</td>
                    <td>{{mtOrderObject.nickName}}</td>
                    <td>{{mtOrderObject.mobilePhone}}</td>
                    <td>{{mtOrderObject.totalCommissionSum.toFixed(2)}}</td>
                    <td>{{mtOrderObject.shareCommissionSum.toFixed(2)}}</td>
                    <td>{{mtOrderObject.selfPurchaseSum.toFixed(2)}}</td>
                    <td>{{mtOrderObject.communityCommissionSum.toFixed(2)}}</td>
                    <td>{{mtOrderObject.inviterCommissionSum.toFixed(2)}}</td>
                    <td>{{mtOrderObject.ordernumber}}</td>

                    <td>{{mtOrderObject.newGroupOrderStatusVal0}}</td>
                    <td>{{mtOrderObject.newGroupOrderStatusVal1}}</td>

                    <td>{{mtOrderObject.refundStatusCount}}</td>
                    <td>{{mtOrderObject.share_userOrderCount}}</td>
                    <td>{{mtOrderObject.order_userOrderCount}}</td>
                    <td>{{mtOrderObject.communityOrderCount}}</td>
                    <td>{{mtOrderObject.inviterOrderCount}}</td>
                </tr>
                <tr>

                    <td>合计</td>
                    <td>{{totalInfo.balanceStatusVal}}</td>
                    <td></td>
                    <td></td>
                    <td></td>
                    <td>{{totalInfo.totalCommissionSum.toFixed(2)}}</td>
                    <td>{{totalInfo.shareCommissionSum.toFixed(2)}}</td>
                    <td>{{totalInfo.selfPurchaseSum.toFixed(2)}}</td>
                    <td>{{totalInfo.communityCommissionSum.toFixed(2)}}</td>
                    <td>{{totalInfo.inviterCommissionSum.toFixed(2)}}</td>
                    <td>{{totalInfo.ordernumber}}</td>

                    <td>{{totalInfo.newGroupOrderStatusVal0}}</td>
                    <td>{{totalInfo.newGroupOrderStatusVal1}}</td>

                    <td>{{totalInfo.refundStatusCount}}</td>
                    <td>{{totalInfo.share_userOrderCount}}</td>
                    <td>{{totalInfo.order_userOrderCount}}</td>
                    <td>{{totalInfo.communityOrderCount}}</td>
                    <td>{{totalInfo.inviterOrderCount}}</td>
                </tr>
                </tbody>
            </table>
        </form>
    </div>

    <div class = "left-margin">共<span id = 'page_number'>{{pageNumber}}</span>页 <span>{{count}}条数据</span></div>

</div>


<!--导入 -->
<div class="am-modal am-modal-no-btn" id="doc-modal-import">
    <div class="am-modal-dialog">
        <div class="am-modal-hd border-bottom" style = "text-align: left;">导入结算订单数据(Excel)
            <a href="javascript: void(0)" class="am-close am-close-spin" data-am-modal-close>&times;</a>
        </div>
        <div class="am-modal-bd body-area">

            <div class="form-group">
                <br><br><input type="file" id="community_xls" required onchange="angular.element(this).scope().selectExcelFile(this.files)" accept="application/vnd.ms-excel/*"><br><br>
            </div>

        </div>
        <div class = "button-area border-top">
            <button type="button" data-am-modal="{target: '#loading'}" class="am-btn am-btn-success right-margin top-margin" ng-show="true" ng-click="import()">保存</button>
        </div>
    </div>
</div>

<div class="alert" style="background: black;opacity: 0.2;position: fixed;top: 0;left: 0;right: 0;bottom:0;display: none ">
    <div class="mian" style="width: 50px;height: 200px;color: white;margin: 20% auto"><img src="../../img/jiazai.gif"></div>
</div>
<div class="am-modal am-modal-loading am-modal-no-btn" id="loading">
    <div class="am-modal-dialog">
        <div class="am-modal-hd">正在载入...</div>
        <div class="am-modal-bd">
            <span class="am-icon-spinner am-icon-spin"></span>
        </div>
    </div>
</div>
<script>$(function ()
{ $("[data-toggle='popover']").popover();
});
</script>